import Ember from 'ember';
import config from 'mall-app-front/config/environment';

export default Ember.Route.extend({
  model() {
    return Ember.$.getJSON(config.rootURL + "api/productCategories");
  },
  redirect(model) {
    if (model.get('length') > 0) {
      this.transitionTo('categories.subs', model.get("firstObject"));
    }
  }
});
